﻿using UnityEngine;
using System.Collections;

namespace TileMapClasses
{
	/// <summary>
	/// Storage class for the overworld map values.
	/// </summary>
	public class Map
	{
		private Vector2 dimentions;
		private Vector3 position;
		private float size;

		/// <summary>
		/// Initializes a new instance of the <see cref="TileMapClasses.Map"/> class.
		/// </summary>
		/// <param name="position">Position.</param>
		/// <param name="width">Width.</param>
		/// <param name="height">Height.</param>
		public Map (Vector3 position, float width, float height)
		{
			this.position = position;
			Width = width;
			Height = height;
			size = Width * Height;
		}

		public Vector3 Position {
			get {
				return position;
			}
			set {
				position = value;
			}
		}

		/// <summary>
		/// Gets or sets the width.
		/// </summary>
		/// <value>The width.</value>
		public float Width {
			get {
				return dimentions.x;
			}
			set {
				dimentions.x = (float)System.Math.Truncate (value);
			}
		}

		/// <summary>
		/// Gets or sets the height.
		/// </summary>
		/// <value>The height.</value>
		public float Height {
			get {
				return dimentions.y;
			}
			set {
				dimentions.y = (float)System.Math.Truncate (value);
			}
		}

		/// <summary>
		/// Gets the size.
		/// </summary>
		/// <value>The size.</value>
		public float Size {
			get {
				return size;
			}
		}
	}
}
